/******************************************************************************/
/* Files to Include                                                           */
/******************************************************************************/

/* Device header file */
#if defined(__dsPIC33E__)
	#include <p33Exxxx.h>
#elif defined(__dsPIC33F__)
	#include <p33Fxxxx.h>
#endif

#include <stdint.h>        /* Includes uint16_t definition                    */
#include <stdbool.h>       /* Includes true/false definition                  */
#include "system.h"        /* System funct/params, like osc/peripheral config */
#include <libpic30.h>
#include "delay.h"

/******************************************************************************/
/* Global Variable Declaration                                                */
/******************************************************************************/

/* i.e. uint16_t <variable_name>; */

/******************************************************************************/
/* Main Program                                                               */
/******************************************************************************/

int16_t main(void)
{
    /* Configure the oscillator for the device */
    ConfigureOscillator();


   	TRISD = 0b00110111; 	// PORTD bit 3, 6 y 7 a salida

	LATD = 0x08;

	while (1)
	{
		LATDbits.LATD3 = ~LATDbits.LATD3; // toggle LATD
                LATDbits.LATD6 = ~LATDbits.LATD6; // toggle LATD
                LATDbits.LATD7 = ~LATDbits.LATD7; // toggle LATD

		Delay1S();	// Delay 1 second

	}

}
